Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[change] using safer calling way of "@api_view" in docs/tutorial/5-relationships-and-hyperlinked-apis.md #3971

Merged
merged 2 commits into from
Mar 1, 2016

Conversation

lynndotconfig
Copy link
Contributor

Description

to fix "@api_view" usage error in "docs/tutorial/5-relationships-and-hyperlinked-apis.md"

"@api_view" usage error.
@xordoquy
Copy link
Collaborator

I don't really see what it fixes. Both tuple and lists should be valid.

@lynndotconfig
Copy link
Contributor Author

If it was only passed by "GET", list is safer then tuple and also can skip the comma.

@xordoquy
Copy link
Collaborator

xordoquy commented Mar 1, 2016

ok, so it's not a fix in itself, just a change to make it safer for Python newcomers.

@@ -11,7 +11,7 @@ Right now we have endpoints for 'snippets' and 'users', but we don't have a sing
from rest_framework.reverse import reverse


@api_view(('GET',))
@api_view(['GET',])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove the coma here to avoid confusion with tuples ?

remove comma
@lynndotconfig lynndotconfig changed the title [FIX] "@api_view" calling error in docs/tutorial/5-relationships-and-hyperlinked-apis.md [change] using safer calling way of "@api_view" in docs/tutorial/5-relationships-and-hyperlinked-apis.md Mar 1, 2016
@lynndotconfig
Copy link
Contributor Author

Yes, for Python newcomers.

@xordoquy xordoquy added this to the 3.4.0 Release milestone Mar 1, 2016
xordoquy added a commit that referenced this pull request Mar 1, 2016
[change] using safer calling way of  "@api_view" in docs/tutorial/5-relationships-and-hyperlinked-apis.md
@xordoquy xordoquy merged commit c2cfb84 into encode:master Mar 1, 2016
@xordoquy
Copy link
Collaborator

xordoquy commented Mar 1, 2016

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants